//
//  GoodAndBadMaterial.m
//  __PRODUCTNAME__
//
//  Created by LL.F on 16/09/15
//  Copyright (c) __ORGANIZATIONNAME__. All rights reserved.
//

#import "GoodAndBadMaterial.h"
#import "Good_Suitable_Not_With.h"
#import "GoodAndBadSuitable_With.h"

@implementation GoodAndBadMaterial

+ (NSDictionary *)objectClassInArray{
    return @{@"suitable_not_with" : [Good_Suitable_Not_With class], @"suitable_with" : [GoodAndBadSuitable_With class]};
}
- (void)setValue:(id)value forKey:(NSString *)key
{
    
    [super setValue:value forKey:key];
    if ([key isEqualToString:@"suitable_not_with"]) {
        NSMutableArray<Good_Suitable_Not_With *>  *infoArray = [NSMutableArray array];
        for (NSDictionary *dic in value) {
            Good_Suitable_Not_With *infoData = [Good_Suitable_Not_With modelWithDic:dic];
            [infoArray addObject:infoData];
        }
        _suitable_not_with = infoArray;
    }
    if ([key isEqualToString:@"suitable_with"]) {
        NSMutableArray<GoodAndBadSuitable_With *>  *infoArray = [NSMutableArray array];
        for (NSDictionary *dic in value) {
            GoodAndBadSuitable_With *infoData = [GoodAndBadSuitable_With modelWithDic:dic];
            [infoArray addObject:infoData];
        }
        _suitable_with = infoArray;
    }
}
@end
